package com.alex.megacj.utils;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;
import org.springframework.core.io.Resource;

public abstract class CommonUtils {

	public static String toString(Resource resource) throws IOException {
		InputStream in = null;
		try {
			in = resource.getInputStream();
			return IOUtils.toString(in);
		} finally {
			IOUtils.closeQuietly(in);
		}
	}
	
}
